from flask import Blueprint, request, jsonify, current_app
import logging, os
from utils import common
model_bp = Blueprint('model', __name__, url_prefix='/model')

# model_bp = common.add_url_to_bp(os.path.dirname(__file__), model_bp)



@model_bp.route('/list')
def list():
    params = request.args
    result = current_app.config['DB'].list_available_model(params.get('enable'))

    return jsonify({"code":0, "data":result})

@model_bp.record
def log(app):
    logging.info('register model blueprint')
